import { connectRouter, RouterState } from 'connected-react-router'
import { combineReducers } from 'redux'
import { History } from 'history'
import authReducer, { AuthState } from './auth'
import categoryReducer, { CategoryState } from './category'

export interface AppState {
  router: RouterState
  auth: AuthState
  category: CategoryState
}

export default function rootReducer(history: History) {
  return combineReducers({
    router: connectRouter(history),
    auth: authReducer,
    category: categoryReducer,
  })
}
